//
//  DownloadHistoryCell.m
//  IntegralDog
//
//  Created by HanenDev on 16/1/25.
//  Copyright © 2016年 hanen. All rights reserved.
//

#import "DownloadHistoryCell.h"
#import "UIView+Extension.h"

#define SCREENWIDTH [UIScreen mainScreen].bounds.size.width
#define STARTX 15.0f

@implementation DownloadHistoryCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.imagView = [[UIImageView alloc]initWithFrame:CGRectMake(STARTX, 10, 60, 60)];
        [self.contentView addSubview:self.imagView];
        
        self.nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(_imagView.maxX + 10, 10, SCREENWIDTH - _imagView.maxX, 20)];
        [self.contentView addSubview:self.nameLabel];
        
        self.editionLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.nameLabel.x, self.nameLabel.maxY, SCREENWIDTH - _imagView.maxX, 20)];
        self.editionLabel.textColor = [UIColor lightGrayColor];
        self.editionLabel.font = [UIFont systemFontOfSize:15.0f];
        [self.contentView addSubview:self.editionLabel];
        
        self.updataLabel = [[UILabel alloc]initWithFrame:CGRectMake(_nameLabel.x, _editionLabel.maxY, _nameLabel.width, 20)];
        self.updataLabel.textColor = [UIColor lightGrayColor];
        self.updataLabel.font = [UIFont systemFontOfSize:15.0f];
        [self.contentView addSubview:self.updataLabel];
        
        self.picView = [[UIImageView alloc]initWithFrame:CGRectMake(SCREENWIDTH - 80 , self.editionLabel.y, 20, 20)];
        [self.contentView addSubview:self.picView];
        
        self.countLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.picView.maxX, self.picView.y, 80, 20)];
        self.countLabel.textColor = [UIColor orangeColor];
        self.countLabel.font = [UIFont systemFontOfSize:16.0f];
        [self.contentView addSubview:self.countLabel];
    }
    return self;
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
